package com.zhj.cloud.eureka.client;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

import javax.ws.rs.GET;

/**
 * eureka 客户端
 * EurekaClientAutoConfiguration：自动配置类进行相应的Bean对象的加载
 *          EurekaInstanceConfigBean：配置文件Bean对象的加载
 *          EurekaServiceRegistry：eureka服务注册Bean对象
 *          EurekaAutoServiceRegistration：自动服务注册，在应用启动完成之后通过事件通知远程服务进行状态的变更
 *          RefreshableEurekaClientConfiguration：
 *              EurekaClient(CloudEurekaClient)：eureka客户端对象，在创建时就会进行服务注册表的拉取，以及服务信息的注册，注册状态改变的通知
 *              ApplicationInfoManager：应用信息管理器
 *              EurekaRegistration：eureka注册器
 *
 */
@SpringBootApplication
@EnableEurekaClient
@RestController
@RequestMapping("/value")
public class EurekaClientApplication {

    @GetMapping
    public String get() {
        return "success";
    }

    public static void main(String[] args) {
        SpringApplication.run(EurekaClientApplication.class);
    }
}
